#ifndef FRIEND_H
#define FRIEND_H

#include <QObject>
#include <QWidget>
#include <QTextEdit>
#include <QListWidget>
#include <QLineEdit>
#include <QPushButton>
#include <QVBoXLayout>
#include <QHBoxLayout>
#include "olineui.h"

class Friend : public QWidget
{
    Q_OBJECT
public:
    explicit Friend(QWidget *parent = nullptr);

    void show_online_user(PDU* pdu);
    void show_online_friend(PDU* pdu);

    void show_group_msg(PDU* pdu);

signals:
    void online_show();

private:
    QTextEdit* m_showMsgTE;
    QListWidget* m_friendListWidget;
    QLineEdit* m_inputMsgLE;

    QPushButton* m_del_friendPB;
    QPushButton* m_flush_friendPB;
    QPushButton* m_show_online_userPB;
    QPushButton* m_search_userPB;
    QPushButton* m_group_chatPB;
    QPushButton* m_private_chatPB;

    OlineUI* m_online;

public:
    void send_online_msg();

    QString search_name;

    QListWidget *friendListWidget() const;

    void flush_friend_func();
};

#endif // FRIEND_H
